<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%@ include file="../common/bootstrap.jsp"%>
<script type="text/javascript">
	$(function(){  //生成验证码         
	    $('#validPic').click(function () {  
	    $(this).hide().attr('src', '<%=basePath%>validCode/validCode.jpg?' + Math.floor(Math.random()*100) ).fadeIn(); });      
	});   
	 
	window.onbeforeunload = function(){  
	    //关闭窗口时自动退出  
	    if(event.clientX>360&&event.clientY<0||event.altKey){     
	        alert(parent.document.location);  
	    }  
	};  
	             
	function changeCode() {  //刷新
	    $('#validPic').hide().attr('src', '<%=basePath%>validCode/validCode.jpg?' + Math.floor(Math.random()*100) ).fadeIn();  
	    event.cancelBubble=true;  
	}  
</script>
<title>用户登录</title>
<style>
#login {
	margin-top: 150px;
}

tr {
	line-height: 25px;
	height: 25px;
	margin: 6px;
}
body{
	background-image:url("<%=basePath%>resources/commons/images/login_bg.jpg");
	background-size:cover;
}
.login_well{
	background-color:rgba(245,245,245,0.6);
	border-radius:5px;
	padding:30px;
}
</style>
</head>
<body>
	<div class="container" id="login">
		<div class="row">
			<div class="col-md-4 col-md-offset-4 login_well">
				<h3>Please Login</h3>
				
				<c:if test="${not(ErrorMessage==null||empty ErrorMessage)}">
					<div class="alert alert-danger" role="alert">
						<span class="glyphicon glyphicon-exclamation-sign"
							aria-hidden="true"></span> <span class="sr-only">Error:</span>
							 <span class="">${ErrorMessage }</span>
					</div>
				</c:if>
				<form action="to_login" role='form' class="form-horizontal" method="post">
					<div class="form-group">
						<div class="col-md-3">
							<label for="username" class="control-label">Username:</label>
						</div>
						<div class="col-md-9">
							<input type="text" class="form-control" name="username"
								id="username" placeholder='Enter The Username'>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-3">
							<label for="password" class="control-label">Password:</label>
						</div>
						<div class="col-md-9">
							<input type="password" class="form-control" name="password"
								id="password" placeholder='Enter The Password'>
						</div>
					</div>
					<!-- 验证码 -->
					<div class="form-group">
						<div class="col-md-3">
							<label for="validCode" class="control-label">ValidCode:</label>
						</div>
						<div class="col-md-5">
							<input type="text" class="form-control" name="validCode"
								id="validCode" placeholder='Enter The ValidCode'>
						</div>
						<div class="col-md-4">
							<img src="<%=basePath%>validCode/validCode.jpg" id="validPic"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-5 col-md-offset-1">
							<input type="checkbox" name="Remember_me">Remember Me
						</div>
						<div class="col-md-5">
							<span>还没账号？</span>
							<a href="<%=basePath%>registe">注册</a>
						</div>
						
					</div>
					<div class="form-group">
						<div class="col-md-3 col-md-offset-2">
							<button class="btn btn-info" type="submit">Submit</button>
						</div>
						<div class="col-md-3 col-md-offset-2">
							<button class="btn btn-default" type="reset">Reset</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>